/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86138
 * Date: 2024-05-22
 * Time: 16:18
 */

class Date{
    int year;
    int month;
    int day;

    public void setDate(int year, int month, int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void printDate(){
        System.out.println(year + "年 " + month + "月 " + day + "日 ");
    }
}

public class May_21 {

    public static void main(String[] args) {
        Date date = new Date();
        date.setDate(2024,5,21);
        date.printDate();
    }
    /*public static void main(String[] args) {
        //int a;//报错
        int a = 0;

        dog d1 = new dog();
        d1.name = "A";
        d1.bark();
        *//*Test test = new Test();
        test.test();

    }*/
}

class dog{//dog是类名
    public int num;
    public String name;//num和name叫做字段或属性或成员变量

    public void bark(){
        System.out.println(name + "在叫");//bark叫做成员方法或行为
    }
}

class Test{
    public void test(){
        System.out.println("test--------");
    }
}


